package com.guarantee.server.config.acpectj;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Description 操作日志使用spring event异步入库，拦截器操作
 * @Author chenli
 * @Date 2019-05-13
 * @Version Copyright (c) 2019,安徽广泽 All rights reserved.
 */
@Aspect
@Slf4j
@Component
public class ControllerAspect {

    @Pointcut("execution(* com.guarantee.server.controller..*.*(..))")
    public void anyMethod() {
    }


    /**
     * @param point :
     */
    @Before("anyMethod()")
    public void around(JoinPoint point) {
        String strClassName = point.getTarget().getClass().getName();
        String strMethodName = point.getSignature().getName();
        log.info("[类名]:{},[方法]:{}", strClassName, strMethodName);
    }

}
